<template lang="html">
  <div class="box">
      <div class="header">
          <el-form class="filterCondition demo-form-inline" :inline="true" label-width="80px">
              <el-input placeholder="运营商名称" v-model="keyword" style="width: 420px;">
                <el-button slot="append" style="width: 120px;" @click="search(1)">搜索</el-button>
              </el-input>
              <el-form-item label="时间段" style="margin-bottom: 0;width: 520px;">
                <el-date-picker v-model="intervalTime" type="daterange" align="right" unlink-panels range-separator="-"
                  start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;"
                  value-format="yyyy-MM-dd HH:mm:ss" >
                </el-date-picker>
              </el-form-item>
          </el-form>
      </div>

      <div class="body">
          <el-table v-loading="loading" :data="tableData.list" style="width: 100%">
              <el-table-column prop="company" align="center" label="运营商名称"></el-table-column>
              <el-table-column prop="phone" align="center" label="联系方式"></el-table-column>
              <el-table-column prop="money" align="center" label="支付金额"></el-table-column>
              <el-table-column prop="create_time"  align="center" label="支付时间"></el-table-column>
          </el-table>
      </div>

      <div class="page_box">
          <el-pagination class="page" layout="prev, pager, next"
            @current-change="yysAgentSystemFeeList" :current-page.sync="currentPage" :page-count='tableData.rows' >
          </el-pagination>
      </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      keyword: '',
      loading: false,
      intervalTime: [],
      tableData: [],
      currentPage: 1
    }
  },
  created () {
    this.search()
  },
  methods:{
    search(page=1){
      this.yysAgentSystemFeeList(page)
    },
    yysAgentSystemFeeList(page=1){
      this.currentPage = page;
      this.$http3.yysAgentSystemFeeList({
        key: this.keyword,
        start_time: (this.intervalTime && this.intervalTime[0]) || '',
        end_time: (this.intervalTime && this.intervalTime[1]) || '',
        page: page
      }).then(res => {
        this.loading = false
        this.tableData =
          res.data.code == 1 ?
            res.data.data : []
      })
    }
  }
}
</script>

<style lang="css" scoped>
@import "../../../my-style/app.css";
/deep/ .el-input-group__append,
.el-input-group__prepend {
  background-color: #3498e9;
  border: none;
  color: white;
}
/deep/ .table_box .preview-img {
  display: block;
  width: 100%;
  height: 30px;
}
.page_box {
  text-align: center;
}
</style>
